From 514f7d55960106d5c67522233630a0923c7053b3 Mon Sep 17 00:00:00 2001 From: Boyuan Yang Date: Tue, 9 Sep 2025 08:26:44 -0400 Subject: [PATCH] Force building with c++17 standard --- debian/changelog | 4 ++- .../patches/0002-Force-build-with-c-17.patch | 31 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 debian/patches/0002-Force-build-with-c-17.patch diff --git a/debian/changelog b/debian/changelog index 18981b5..842727c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,10 @@ opencc (1.1.9+ds1-2) unstable; urgency=medium * debian/patches/backport/0006-Fix-build-for-gcc-15-934.patch, debian/patches/backport/0007-Fix-deprecated-declarations-in-C-17.patch: Backport upstream patches to fix FTBFS with GCC 15. (Closes: #1097512) + * debian/patches/0002-Force-build-with-c-17.patch: Force building with + c++17 standard to fix FTBFS with the new googletest. - -- Boyuan Yang Tue, 09 Sep 2025 08:20:41 -0400 + -- Boyuan Yang Tue, 09 Sep 2025 08:26:01 -0400 opencc (1.1.9+ds1-1) unstable; urgency=medium diff --git a/debian/patches/0002-Force-build-with-c-17.patch b/debian/patches/0002-Force-build-with-c-17.patch new file mode 100644 index 0000000..b06452f --- /dev/null +++ b/debian/patches/0002-Force-build-with-c-17.patch @@ -0,0 +1,31 @@ +From: Boyuan Yang +Date: Tue, 9 Sep 2025 08:25:14 -0400 +Subject: Force build with c++17 + +Needed by googletest. +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ba28233..25abb7d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -155,7 +155,7 @@ add_definitions( + + if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + add_definitions( +- -std=c++14 ++ -std=c++17 + -Wall + ) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread") +@@ -164,7 +164,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + endif () + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + add_definitions( +- -std=c++14 ++ -std=c++17 + -Wall + ) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread") diff --git a/debian/patches/series b/debian/patches/series index eb0994e..5179202 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,5 @@ 0001-use-cmake-install-libdir.patch +0002-Force-build-with-c-17.patch 0003-no-remote-images-when-reading-docs-on-disk.patch 0004-Use-system-googletest.patch 0005-Disable-build-in-setup.py.patch -- 2.30.2